/*
 * Filename: g:\espidf_workspace\idf_S3_T-Watch\main\audio\audio_player.h
 * Path: g:\espidf_workspace\idf_S3_T-Watch\main\audio
 * Created Date: Monday, June 23rd 2025, 11:18:25 am
 * Author: sss
 *
 * Copyright (c) 2025 Your Company
 */
#pragma once
#include "driver/i2s.h"
#include "driver/i2s_types.h"
#include "driver/gpio.h"
#include "esp_log.h"

// // MAX98357A
// #define AUDIO_PLAYER_IIS_BCK (GPIO_NUM_48)
// #define AUDIO_PLAYER_IIS_WS (GPIO_NUM_15)
// #define AUDIO_PLAYER_IIS_DOUT (GPIO_NUM_46)
// #define AUDIO_PLAYER_PORT (I2S_NUM_0)


class AUDIO_PLAYER
{
private:
    AUDIO_PLAYER(/* args */);
    ~AUDIO_PLAYER();
    /* data */
   
public:
    static AUDIO_PLAYER &get_instance()
    {
        static AUDIO_PLAYER instance;
        return instance;
    };
    AUDIO_PLAYER(AUDIO_PLAYER const &) = delete;
    AUDIO_PLAYER& operator=(AUDIO_PLAYER const &) = delete;
    void init(const char *initType);
    void deinit();
    void play_url(const char *audio_url);// play audio from url https://www.example.com/audio.mp3 播放
    // void set_url(const char *audio_url); // set audio url to play
    void say_chinese(const char *chinese_str); // say chinese words
    void play();
    void stop();
    void pause();
    void resume();

    char decodeType[5]; // default decode type is mp3
};

